
 
<form class="form-horizontal" method="Post" id="busqueda">
    <input type="hidden" id="txt_menu" name="txt_menu" value="1" >
    <legend>Busqueda</legend>
    <table>
        <tr>
            <td>
                <div class="control-group">
                    <label class="control-label">Tipo Sesion</label>
                    <div class="controls input-medium">
                        <select id="tipo_sesion" name="tipo_sesion">
                            <option value="">Seleccione opción..</option>
                            <option value="1">Facial</option>
                            <option value="2">Horizontal</option>
                            <option value="3">Vertical Intermedia</option>
                            <option value="4">Vertical Fuerte</option>
                        </select>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <div class="well well-small">
        <div class="row-fluid">
            <h5>Fechas Sesion/es</h5>
            <div class="control-group" style="display: inline-block;">
                <label class="control-label">Desde</label>
                <div class="controls">
                    <input class="input-small datepicker" type="text" id="fecha_desde" name="fecha_desde" placeholder="Fecha">
                </div>
            </div>
            <div class="control-group" style="display: inline-block;" >
                <label class="control-label">Hasta</label>
                <div class="controls">
                    <input class="input-small datepicker" type="text" id="fecha_hasta" name="fecha_hasta" placeholder="Fecha">
                </div>
            </div>
            <div class="control-group" style="display: inline-block;">
                <label class="control-label"></label>
                <div class="controls" >
                    <input style="width:200px; "class="btn btn-large btn-primary" type="submit" name="buscar" value="Buscar "> 
                </div>
            </div>
        </div>
    </div>
</form>

<?php if (count($this->sesionesEntreFechas)): ?>
<?php $monto = 0; $dif_monto = 0;?>
    <h4>
        <p class="text-warning">Tipo Sesion : <?php echo $this->tipoSesion ? $this->tipoSesion : 'Todas'; ?>
        </p>
    </h4>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Fecha</th>
                <th>Monto</th>
                <th>Dif. Monto</th>
            </tr>
        </thead>
        <?php $sesion = new Doctrine_Model_Entities_Sesiones(); ?>
        <tbody>
            <?php foreach ($this->sesionesEntreFechas as $sesion): ?>
                        
                <tr>
                    <td><?php echo $sesion->getFechaSesion()->format('m-d-Y'); ?></td>
                    <td><?php echo $sesion->getTasa(); ?></td>
                    <td><?php echo $sesion->getDif_monto(); ?></td>
                    <?php $monto += $sesion->getTasa() * 1;
                    $dif_monto += $sesion->getDif_monto() * 1; ?>    
                </tr>
            <?php endforeach; ?>
            <tr style="background-color: #F0ECF6;">
                <td><b>Parcial</b></td><td><?php echo $monto; ?></td><td><?php echo $dif_monto; ?></td> 
            </tr>
            <tr style="background-color: #B2D189;">
                <td><b><strong>Total</strong></b></td><td colspan="2"><strong><?php echo $monto + $dif_monto; ?></strong></td> 
            </tr>
        </tbody>
    </table>
    
<?php endif; ?>

<script type="text/javascript">
    $(document).ready(function(){
        $( ".datepicker" ).datepicker({dateFormat: 'dd/mm/yy',changeMonth:true,changeYear:true});
        $(".ingreso_activo").colorbox({
            iframe:true, 
            innerWidth: "60%", 
            innerHeight: "60%",
            onClosed:function(){ location.reload(true); } });

    });
</script>

<script type="text/javascript">

    $(document).ready(function(){ 
            
            $("#busqueda").validate({
                ignoreTitle: false,
                errorPlacement: true,
                rules: {
                    /* personal cliente */
                    //slc_tipo_cliente: {required: true}, 
                    fecha_desde: {required: true, dateITA: true},
                    fecha_hasta: {required: true, dateITA: true}
                },
                messages: {
                    tipo_sesion: {required: "aaaaaaa"},
                    cant_sesion: {required: "bbbbbbb"}
                },
                highlight: function(element, errorClass) {
                    $(element).attr('style', 'border:1px solid red; background-color:#FF7373; color:black;');
                },
                unhighlight: function(element, errorClass, validClass) {
                    $(element).attr("style", "");
                },
                errorPlacement: function(error, element) {
                }
            });
    });
    
    function borrarCliente(elem){
                    Sexy.confirm('Se eliminara de forma permanente un cliente.Esta seguro?',
                    {             
                        onComplete: function (valor){
                            if (valor) {
                                 $(".ingreso_activo").colorbox.close(); 
                                Sexy.alert('Cliente eliminado con Exito!');    
                            } 
                        }
                    });
                return false;
    }
    
</script>